export default [
  {
    path: '/',
    redirect: '/profile'
  },
  {
    path: '/home',
    name: 'dp-home',
    /* @vite-ignore */
    component: () => import('@/views/home/index.vue'),
    children: [
      { 
        path:'',
        name: 'dp-main',
        meta:{
          keepAlive: true,
          isShow: true
        },
        /* @vite-ignore */
        component: () => import('@/views/home/Desktop/Main/index.vue'),
        children: [
             {
              /* @vite-ignore */
            component: () =>import('@/views/home/Desktop/Main/Cardlist/index.vue'),
            name: 'dp-main-cardlist',
            path: '',
            beforeEnter: (to, from) => {
              //在文章详情页面返回主页则滚动到上一次点击文章的位置
              if(from.name =='dp-main-detail'){
     
              }
            }
          }
        ]
      },
      {
        name: 'dp-main-detail',
        path: ':id',
        props: true,
        /* @vite-ignore */
        component: () => import('@/views/home/Desktop/Main/Cardlist/details/index.vue')
      }
    ]
  },
  {
    path: '/my',
    name: 'dp-my',
    /* @vite-ignore */
    component: () => import('@/views/home/Desktop/My/index.vue')
  },
  {
    path:'/profile',
    name:'dp-login',
    component:()=>import('@/views/home/components/login/index.vue')
  },   
  {
    path:'/register',
    name:'dp-register',
    component:()=>import('@/views/home/components/register/index.vue')
  },
  {
    path:'/forgot',
    name:'dp-forgot',
    component:()=>import("@/views/home/components/forgotPassword/index.vue")
  },
  {
    path: '/:pathMatch(.*)*', // 捕获所有未匹配的路径
    name: 'not-found',
    component: () => import('@/views/home/components/404/index.vue') // 404 页面组件
  }
]

